from selenium import webdriver
from time import sleep
from selenium.webdriver.common.by import By
from selenium.webdriver import ActionChains
driver = webdriver.Chrome()
sleep(2)
driver.get("http://www.baidu.com")
sleep(2)
driver.maximize_window()
sleep(2)
driver.find_element(By.CSS_SELECTOR,"#kw").send_keys("周慧敏")
sleep(2)
driver.find_element(By.CSS_SELECTOR,"#su").click()
sleep(5)
#滚动条js语法:window.scrollTo(X,Y)
driver.execute_script("window.scrollTo(0,500)")
sleep(5)
driver.execute_script("window.scrollTo(0,1500)")
sleep(5)
driver.quit()